package com.gumbou.mis.pos.service.impl;

import com.gumbou.mis.pos.entity.PosCategory;
import com.gumbou.mis.pos.mapper.CategoryMapper;
import com.gumbou.mis.pos.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：JunBao Huang
 * @description：TODO
 * @date ：2021/9/22 22:37
 */
@Service
public class CategoryServiceImpl implements ICategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    /**
     * 通过ID查询单条数据
     *
     * @param posCategoryId 主键
     * @return 实例对象
     */
    @Override
    public PosCategory queryById(Integer posCategoryId) {
        return this.categoryMapper.queryById(posCategoryId);
    }
    /**
     * 查询指定行数据
     *
     * @param posCategory 筛选条件
     * @return 查询结果
     */
    @Override
    public List<PosCategory> queryAll(PosCategory posCategory) {
        return this.categoryMapper.queryAll(posCategory);
    }
    /**
     * 新增数据
     * @param posCategory 实例对象
     */
    @Override
    public void insert(PosCategory posCategory) {
        this.categoryMapper.insert(posCategory);
    }

    /**
     * 更新数据
     * @param posCategory
     */
    @Override
    public void update(PosCategory posCategory) {
        this.categoryMapper.update(posCategory);
    }

    /**
     * 删除数据
     * @param posCategoryId 主键
     * @return
     */
    @Override
    public boolean deleteById(Integer posCategoryId) {
        return this.categoryMapper.deleteById(posCategoryId) > 0;
    }
}
